﻿#ifndef COMMON_H
#define COMMON_H

#include <stdint.h>
#include "mvcapi.h"

namespace mv {
// 运行状态
enum class run_status : int32_t {
	running = 0,
	stoping,
	stoped
};

enum class connect_status : int32_t {
	disconnected = 0,
	connected,
	rejected,
};

typedef void(MV_STDCALL* status_callback)(const char* id, const uint8_t priority, const connect_status old_status, const connect_status new_status);
typedef void(MV_STDCALL* message_callback)(const char* id, const uint8_t* message, const int32_t length);

const int64_t LOGIN_RETRY_INTERVAL = 5;
const int64_t HEARTBEAT_INTERVAL = 1;

const uint8_t HEADER[] = { (uint8_t)0XAA, (uint8_t)0X55 };

const int CMD_HEARTBEAT = 0X00; // 心跳包
const int CMD_SERVER_MESSAGE = 0X01;   // 服务端信息
const int CMD_CLIENT_MESSAGE = 0x02;   // 客户端信息
const int CMD_LOGIN = 0xFF;     // 登录包
} // namespace mv

#endif // !COMMON_H

